import { watch } from 'vue'
import store from '../store'
import i18n from '../i18n'
export function generateTitle(title: string) {
  return i18n.global.t('msg.route.' + title)
}

/**
 *
 * 监听语言变化,同时执行cbs
 */
export function watchSwitchLang(...cbs: any) {
  watch(
    () => store.getters.language,
    () => {
      cbs.forEach((cb:any) => {
        cb(store.getters.language)
      })
    }
  )
}
